-- GENERATED SPELL FOR [Forgotten Depths High Priest] --


function spell0_31037(pUnit, Event) --@Encasing Webs,n/a--
pUnit:FullCastSpellOnTarget(4962,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31037', 8000, 1)
end

function spell1_31037(pUnit, Event) --@Mind Sear,n/a--
pUnit:FullCastSpellOnTarget(32000,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31037', 3000, 1)
end

function Sorts_31037(pUnit, Event)
local choix_sorts_31037 = math.random(0, 1)
if choix_sorts_31037 == 0 then
pUnit:RegisterEvent('spell0_31037', 1, 1)
end
if choix_sorts_31037 == 1 then
pUnit:RegisterEvent('spell1_31037', 1, 1)
end
end

function mob31037_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_31037', math.random(1500, 3000), 1)
end

function mob31037_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31037_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31037_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(31037, 1, 'mob31037_Action')
RegisterUnitEvent(31037, 2, 'mob31037_Leave')
RegisterUnitEvent(31037, 3, 'mob31037_Kill')
RegisterUnitEvent(31037, 4, 'mob31037_Die')
